<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="Voucher.aspx.cs" Inherits="Pages_Voucher" Title="Voucher Entry"  MaintainScrollPositionOnPostback ="true"%>

<%@ Register Src="../WebUserControl_acctype.ascx" TagName="WebUserControl_acctype"
    TagPrefix="uc1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" language="javascript">
    var prm = Sys.WebForms.PageRequestManager.getInstance();
    prm.add_pageLoaded(pageLoaded);
    prm.add_beginRequest(beginRequest);
    var postbackElement;

    function beginRequest(sender, args) {
        postbackElement = args.get_postBackElement();
    }

    function pageLoaded(sender, args) {
        var updatedPanels = args.get_panelsUpdated();
        if (typeof(postbackElement) == "undefined") {
            return;
        }
        if (postbackElement.id.toLowerCase().indexOf('GridView1') > -1) {
            $get("divScroll").scrollTop = $get("hdnScrollTop").value;
        }
     }
</script>
<div>
    <table>
        <tr>
            <td style="width: 3px">
                Month<br />
                <br />
                    Year</td>
            <td style="width: 3px">
                <asp:DropDownList ID="DropDownListMonth" runat="server" Enabled="False">
                    <asp:ListItem Value="1">Jan</asp:ListItem>
                    <asp:ListItem Value="2">Feb</asp:ListItem>
                    <asp:ListItem Value="3">Mar</asp:ListItem>
                    <asp:ListItem Value="4">Apr</asp:ListItem>
                    <asp:ListItem Value="5">May</asp:ListItem>
                    <asp:ListItem Value="6">Jun</asp:ListItem>
                    <asp:ListItem Value="7">Jul</asp:ListItem>
                    <asp:ListItem Value="8">Aug</asp:ListItem>
                    <asp:ListItem Value="9">Sep</asp:ListItem>
                    <asp:ListItem Value="10">Oct</asp:ListItem>
                    <asp:ListItem Value="11">Nov</asp:ListItem>
                    <asp:ListItem Value="12">Dec</asp:ListItem>
                </asp:DropDownList><br />&nbsp;<asp:ScriptManager ID="ScriptManager1" 
                    runat="server">
                </asp:ScriptManager>
&nbsp;<asp:DropDownList ID="DropDownListYear" runat="server" Width="138px" OnLoad="Page_Load" 
                    Enabled="False">
                        <asp:ListItem>1999</asp:ListItem>
                        <asp:ListItem>2000</asp:ListItem>
                        <asp:ListItem>2001</asp:ListItem>
                        <asp:ListItem>2002</asp:ListItem>
                        <asp:ListItem>2003</asp:ListItem>
                        <asp:ListItem>2004</asp:ListItem>
                        <asp:ListItem>2005</asp:ListItem>
                        <asp:ListItem>2006</asp:ListItem>
                        <asp:ListItem>2007</asp:ListItem>
                        <asp:ListItem>2008</asp:ListItem>
                        <asp:ListItem>2009</asp:ListItem>
                        <asp:ListItem>2010</asp:ListItem>
                        <asp:ListItem>2011</asp:ListItem>
                        <asp:ListItem>2012</asp:ListItem>
                        <asp:ListItem>2013</asp:ListItem>
                        <asp:ListItem>2014</asp:ListItem>
                        <asp:ListItem>2015</asp:ListItem>
                        <asp:ListItem></asp:ListItem>
                    </asp:DropDownList>
                <asp:TextBox ID="TextBoxDate" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBoxDate_CalendarExtender2" runat="server" 
                    Enabled="True" TargetControlID="TextBoxDate">
                </cc1:CalendarExtender>
                <cc1:CalendarExtender ID="TextBoxDate_CalendarExtender" runat="server" 
                    Enabled="True" TargetControlID="TextBoxDate">
                </cc1:CalendarExtender>
            </td>
            <td style="width: 3px">
                    Voucher</td>
            <td style="width: 3px">
                   <asp:DropDownList ID="DropDownListRefn" runat="server" Width="78px" AutoPostBack="True" OnSelectedIndexChanged="DropDownList1_SelectedIndexChanged">
                       <asp:ListItem>JV</asp:ListItem>
                       <asp:ListItem>IV</asp:ListItem>
                       <asp:ListItem>BM</asp:ListItem>
                       <asp:ListItem>CM</asp:ListItem>
                       <asp:ListItem>CD</asp:ListItem>
                       <asp:ListItem>BD</asp:ListItem>
                   </asp:DropDownList></td>            
            <td style="width: 3px">
                   <asp:TextBox ID="TextBox_Refn" runat="server" Width="70px"></asp:TextBox></td>
            <td style="width: 3px">
                    <uc1:WebUserControl_acctype ID="WebUserControl_acctype1" runat="server" />
            </td>
            <td style="width: 3px">
                    <asp:Button ID="ButtonDebit" runat="server" OnClick="ButtonDebit_Click" Text="Select DEBIT" Width="128px" /><br /> &nbsp;
                    <asp:Button ID="ButtonCredit" runat="server" OnClick="ButtonCredit_Click" Text="Select CREDIT" /></td>
            <td style="width: 2px">
                <asp:Label ID="Label2" runat="server" Text="Taka:"></asp:Label>
                <asp:TextBox ID="TextBoxAmount" runat="server"></asp:TextBox><br /> &nbsp;&nbsp;
                <asp:Label ID="Label3" runat="server" Text="Narration:"></asp:Label>
                <asp:TextBox ID="TextBoxExplain" runat="server"></asp:TextBox><br /> &nbsp;
                <asp:Button ID="ButtonAmount" runat="server" OnClick="ButtonAmount_Click" Text="Put Amount" />
                   
            </td>
            <td style="width: 3px">
            </td>            


        </tr>
        </table>
        <table>
        <tr>
            <td colspan = 10 style="width: 900px">
            <asp:UpdatePanel ID="updateGrid" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
            <input type="hidden" id="hdnScrollTop" runat="server" value="0" /> 
             <div id="divScroll" style="height:200px; overflow-x:hidden; overflow-y:scroll;" onscroll="$get('hdnScrollTop').value = this.scrollTop;">
                    <asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowDeleting="GridView1_RowDeleting"  Width="900px" AutoGenerateColumns="False">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:CommandField ButtonType="Button" ShowDeleteButton="True" />
                            <asp:BoundField DataField="acctypename" HeaderText="acctypename" >
                                <ItemStyle Width="600px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="accname" HeaderText="Accname" >
                                <ItemStyle Width="500px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="amount" HeaderText="Amount" >
                                <HeaderStyle HorizontalAlign="Right" />
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="acctype" HeaderText="DEBACCTYPE" />
                            <asp:BoundField DataField="acccode" HeaderText="DEBITACC" />
                            <asp:BoundField DataField="explain" HeaderText="Narration" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    <br />
                    </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
             </td>            
        </tr>
    </table>
        <table>
        <tr>
            <td colspan = 10 style="width: 900px">
                <div style="overflow:scroll; height:200px;">
                        &nbsp;<asp:GridView ID="GridView2" runat="server" CellPadding="4" ForeColor="#333333" GridLines="None" OnRowDeleting="GridView2_RowDeleting" Width="900px" AutoGenerateColumns="False">
                        <RowStyle BackColor="#EFF3FB" />
                        <Columns>
                            <asp:CommandField ShowSelectButton="True" />
                            <asp:CommandField ButtonType="Button" ShowDeleteButton="True" />
                            <asp:BoundField DataField="acctypename" HeaderText="acctypename" >
                                <ItemStyle Width="600px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="accname" HeaderText="accname" >
                                <ItemStyle Width="500px" />
                            </asp:BoundField>
                            <asp:BoundField DataField="amount" HeaderText="Amount">
                                <HeaderStyle HorizontalAlign="Right" />
                                <ItemStyle HorizontalAlign="Right" />
                            </asp:BoundField>
                            <asp:BoundField DataField="acctype" HeaderText="CRACCTYPE" />
                            <asp:BoundField DataField="acccode" HeaderText="CREDITACC" />
                            <asp:BoundField DataField="explain" HeaderText="Narration" />
                        </Columns>
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <EditRowStyle BackColor="#2461BF" />
                        <AlternatingRowStyle BackColor="White" />
                    </asp:GridView>
                    </div>            
            </td>
        </tr>
    </table>
        <table style="width: 800px; height: 40px" id="TABLE1">
           <tr>
                <td style="width: 500px">
                    &nbsp; &nbsp;<asp:Label ID="Label11" runat="server" Text="Narration : "></asp:Label>
                    &nbsp;<asp:TextBox ID="TextBox_explain" runat="server" Width="200px"></asp:TextBox>
                   
                    &nbsp;&nbsp<asp:Button ID="ButtonSave" runat="server" Text="Save" OnClick="ButtonSave_Click" Width="101px" /></td>
            </tr>
        </table>
    
    </div>
    <asp:Label ID="Label1" runat="server"></asp:Label> 
</asp:Content>